<script>
import axios from 'axios';
export default {
    data() {
        return {
            headers: ['id', '名称', '省份', '执照号', '法人', '电话', '状态', '操作'],
            alldata: null
        }
    },
    mounted() {
        this.loadData();
    }, name: '商户列表',
    props: { title: { type: String, default: 'default title' } },
    components: {},
    methods: {
        loadData() {
            this.axios.get('/merchant/poslist', {
                params: { page: 1, pagesize: 5 }
            }).then(response => {
                this.alldata = response.data.msg;
            }).catch(error => {
                if (error.response) {
                    console.log(error.response.data);
                    console.log(error.response.status);
                    console.log(error.response.headers);
                } else {
                    //在设置触发错误的请求时发生了错误
                    console.log('Error', error.message);
                }
            });
        }
    }
}
</script>
<template>
    <subNavbar title="商户管理" subtitle="商户列表"></subNavbar>
    <div class="row">
        <div class="col-md-12 stretch-card">
            <div class="card">
                <div class="card-body">
                    <p class="card-title">Recent Purchases</p>
                    <div class="table-responsive">
                        <table id="recent-purchases-listing" class="table">
                            <thead>
                                <trHeader :headers="headers"></trHeader>
                            </thead>
                            <tbody>
                                <trPosInfo v-for="item in alldata" :item="item"></trPosInfo>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<style></style>